<template>
<Tabs :value="tab" @on-click="changeTab">
  <TabPane label="未开始" name="1">
    <op ref="op"></op>
  </TabPane>
  <TabPane label="待审批" name="2">
    <doing ref="doing"></doing>
  </TabPane>
    <TabPane label="待收件" name="3">
    <cin ref="cin"></cin>
  </TabPane>
  <TabPane label="检验" name="4">
    <flowing ref="flowing"></flowing>
  </TabPane>
    <TabPane label="鉴定" name="5">
    <sfjd ref="jd"></sfjd>
  </TabPane>
    <TabPane label="待取件" name="6">
    <cout ref="cout"></cout>
  </TabPane>
  <TabPane label="已完成" name="7">
    <finish ref="finish"></finish>
  </TabPane>
</Tabs>
</template>
<script>
import op from './sfop'
import doing from './sfdoing'
import flowing from './sfflowing'
import finish from './sffinish'
import cin from './sfcin'
import cout from './sfcout'
import sfjd from './sf_jd'
export default {
    data () {
        return {
            tab: this.$route.params.tab
        }
    },
    components: {
        op,
        doing,
        flowing,
        finish,
        cin,
        cout,
        sfjd
    },
    methods: {
        changeTab (params) {
            // console.log(params)
            this.getAll(params)
        },
        getAll (value) {
            let refStr = ''
            switch (value) {
            case '1':
                refStr = 'op'
                break
            case '2':
                refStr = 'doing'
                break
            case '3':
                refStr = 'cin'
                break
            case '4':
                refStr = 'flowing'
                break
            case '5':
                refStr = 'jd'
                break
            case '6':
                refStr = 'cout'
                break
            case '7':
                refStr = 'finish'
                break
            default:

            }
            this.$refs[refStr].getall()
        }
    },
    mounted () {
        this.getAll('1')
    }
}
</script>